{include file="../../../application/admin/view/public/head" /}
<div class="page-container p10">

    <div class="my-toolbar-box" >
        <div class="center mb10">
            <form class="layui-form " action="{:url()}"  method="post">
                时间自
                <div class="layui-input-inline">
                    <input type="text" name="start" required lay-verify="required" placeholder="开始时间" id="startTime" value="{$param['start']}" autocomplete="off" class="layui-input">

                </div>
                至
                <div class="layui-input-inline">
                    <input type="text" name="end" required lay-verify="required" placeholder="结束时间" id="endTime" value="{$param['end']}" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <select class="layui-select" name="app_id">
                        <option value="">全部</option>
                        {foreach $applists as $appId =>$appName}
                        <option value="{$appId}"
                                {if $appId == $param.app_id}
                                selected
                                {/if}
                        >{$appName}</option>

                        {/foreach}
                    </select>
                </div>
                <button class="layui-btn mgl-20 j-search" >查询</button>
            </form>
        </div>
        <blockquote class="layui-elem-quote">
            在此时间段内 <span class="layui-badge">安卓</span> 设备数：<span class="layui-badge">{$androidSum|default=0}</span>台；<span class="layui-badge">苹果 </span>设备数：<span class="layui-badge">{$iosSum|default=0}</span>台。
        </blockquote>
        <div class="layui-btn-group">
            <a href="{:url('zhibostatistics')}?setType=today" class="layui-btn {if $param['setType'] == 'today'} {else/}layui-btn-primary{/if}">今日统计</a>
            <a href="{:url('zhibostatistics')}?setType=yesterday" class="layui-btn {if $param['setType'] == 'yesterday'} {else/}layui-btn-primary{/if}" >昨日统计</a>
            <a href="{:url('zhibostatistics')}?setType=week" class="layui-btn {if $param['setType'] == 'week'} {else/}layui-btn-primary{/if}" >本周</a>
            <a href="{:url('zhibostatistics')}" class="layui-btn layui-btn-primary" >清除选择</a>

        </div>
    </div>

     <form class="layui-form " method="post" id="pageListForm">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="80">类别</th>
                <th width="100">直播名称</th>
                <th width="100">唯一设备数</th>
                <th width="100">访问次数</th>
            </tr>
            </thead>

            {volist name="list" id="vo"}
            <tr>
                <td>{$vo.type_name}</td>
                <td>【{$vo.zhibo_name}】{$vo.zhibo_qiudui} </td>
                <td>
                    <a data-full="1" data-href="{:url('uniqueDeviceList',['setType'=>$param['setType'],'start'=>$param['start'],'end'=>$param['end']])}?zhibo_id={$vo.zhibo_id}" class="layui-badge-rim j-iframe" href="javascript:void(0);" data-title="【{$vo.zhibo_name}】{$vo.zhibo_qiudui}访问设备列表">{$vo.device_num}</a>
                </td>
                <td>
                    <a data-full="1" data-href="{:url('deviceLogList',['setType'=>$param['setType'],'start'=>$param['start'],'end'=>$param['end']])}?zhibo_id={$vo.zhibo_id}" class="layui-badge-rim j-iframe" href="javascript:void(0);" data-title="【{$vo.zhibo_name}】{$vo.zhibo_qiudui}访问记录">{$vo.num}</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

        <div id="pages" class="center"></div>

    </form>
</div>

{include file="../../../application/admin/view/public/foot" /}


<script type="text/javascript">
    var curUrl="{:url('ulog/zhibostatistics',$param)}";
    layui.use(['laypage', 'layer','laydate'], function() {
        var laypage = layui.laypage
                , layer = layui.layer,laydate=layui.laydate;
        laydate.render({
            elem: '#startTime'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#endTime'
            ,type: 'datetime'
        });
        laypage.render({
            elem: 'pages'
            ,count: {$total}
            ,limit: {$limit}
            ,curr: {$page}
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj,first){
                if(!first){
                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
                }
            }
        });
    });
</script>
</body>
</html>